<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

</body>
<script>
    // 1.函数就是对代码的大量封装，提供程序可维护性、可读性、可拓展性(公用代码的封装就是重复代码)
    // 2.传参
    // 3.返回值

    function fn() {
        console.log("000000");
    }
    const fn1 = () => {
        console.log("111111");
    }
    fn();
    fn1();

    function sum(a1, a2) {
        return a1 + a2;
    }

    const sum1 = (a1, a2) => {
        return a1 + a2;
    }
    const sum2 = (a1, a2) => a1 + a2;
    console.log(sum(1, 2));
    console.log(sum1(1, 2));
    console.log(sum2(1, 3));
</script>

</html>